#ifndef SHOWIMG_H
#define SHOWIMG_H
#include <QMainWindow>
#include <QMainWindow>
#include <QPushButton>
#include <QLabel>
#include <QPixmap>
#include <QPainter>
#include <QTimer>
#include <QDateTime>
#include<QMessageBox>
#include <QCloseEvent>
class MyshowImg : public QMainWindow
{
    Q_OBJECT
public:
    explicit MyshowImg(QWidget *parent = nullptr);
private:
    QLabel *imageLabel;
    QPixmap pixmap;
    QTimer *timer;
public:
    void closeEvent(QCloseEvent *event)
    {
        timer->stop(); // 停止定时器
        imageLabel->close();
        QMainWindow::closeEvent(event);
        event->accept(); // 允许关闭窗口
    }
private slots:
    void openImage();
};
#endif // SHOWIMG_H
